import request from '@/utils/request';

// 获取设备实时状态
export function getDeviceStatus(deviceNo: string, params?: any) {
  return request({
    url: `/vending/monitor/status/${deviceNo}`,
    method: 'get',
    params
  });
}

// 获取设备历史状态
export function getDeviceHistory(deviceNo: string, start: string, end: string) {
  return request({
    url: `/vending/monitor/history/${deviceNo}`,
    method: 'get',
    params: {
      start,
      end
    }
  });
}

// 更新设备状态
export function updateDeviceStatus(data: any) {
  return request({
    url: '/vending/monitor/status',
    method: 'put',
    data
  });
}

// 添加设备状态
export function addDeviceStatus(data: any) {
  return request({
    url: '/vending/monitor/status',
    method: 'post',
    data
  });
}
